// const baseUrl = 'http://1.119.169.71:10012/';
window.setConfig = function (baseUrl) {
  if (!baseUrl) {
    baseUrl = window.location.protocol + "//" + window.location.host;
  }
  window.serviceUrl = {
    terrainUrl: "http://data.mars3d.cn/terrain",
    baseLayer: `${baseUrl}/mapserver/vmap/黄冈市电子地图/getMap?styleId=深色系&x={TileCol}&y={TileRow}&l={TileMatrix}&ratio=1&tilesize=512`,
    baseFangwu: `${baseUrl}/mapserver/data/房屋101/getData?x={x}&y={y}&l={z}&styleId=房屋101&tilesize=256`,
    poiLayer: `${baseUrl}/mapserver/黄冈市电子地图/POI/query`
  };

  // 是否开启缩放
  window.turnOnZoom = true;
  window.basicWidth = 1920;
  window.basicHeight = 1080;
  window.scale = {};

  // 模块
  window.tableData = [{
    name: '综合概览',
    isChecked: true,
    path: 'overview',
    view: {
      lon: 114.91759280349012,
      lat: 30.18319924930991,
      high: 23344.856359285495,
      heading: 3.036701600874383,
      pitch: -30.96713963586404,
      roll: 0
    }
  },
  {
    name: '标准地址',
    isChecked: false,
    path: 'standard-address'
  },
  {
    name: '实有人口',
    isChecked: false,
    path: 'real-population'
  },
  {
    name: '实有房屋',
    isChecked: false,
    path: 'building'
  },
  {
    name: '实有单位',
    isChecked: false,
    path: 'real-unit'
  }
  ];

  window.stratifiedHouseholdDivision = {
    serviceUrl: baseUrl,
    serviceName: '中环坐标城',
    layerName_b: '中环坐标城栋',
    layerName_u: '中环坐标城单元',
    layerName_h: '中环坐标城户'
  };

  window.communityVisualAngle = {
    lon: 114.88569733733326,
    lat: 30.44480339146366,
    high: 862.3666075176293,
    heading: 349.9496370072906,
    pitch: -20.924942378279955,
    roll: 0.0015009769129960833
  };

  window.baseMap = [
    {
      id: 1,
      name: '电子底图',
      activeImg: 'dianzi',
      url: `${baseUrl}/mapserver/vmap/黄冈市电子地图/getMap?styleId=深色系&x={TileCol}&y={TileRow}&l={TileMatrix}&ratio=1&tilesize=512`,
      // labelUrl: `${baseUrl}/mapserver/label/黄冈市电子地图/getDatas?x={x}&y={y}&l={z}&styleId=深色系&tilesize=512`
      labelUrl: `${baseUrl}/mapserver/label/黄冈市电子地图/getMap?styleId=深色系&x={TileCol}&y={TileRow}&l={TileMatrix}&ratio=1&tilesize=512`
    },
    {
      id: 2,
      name: '影像底图',
      activeImg: 'yingxiangditu',
      url: 'http://{s}.tianditu.gov.cn/img_c/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=6c8234011ded04e095ef3b9ae8dd1e0b',
      labelUrl: 'http://{s}.tianditu.gov.cn/cia_c/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=6c8234011ded04e095ef3b9ae8dd1e0b'
    }
  ];
};
